export interface LoginData {
  username: string;
  password: string;
  types: string[];
}

export interface RegisterData {
  username: string;
  password: string;
}

// 登录
export function login(data: LoginData) {
	// @ts-ignore
	return uni.$uv.http.post('/login', data, {custom: {auth: false}});
}

// 注册
export function register(data: RegisterData) {
	// @ts-ignore
	return uni.$uv.http.post('/register', data, {custom: {auth: false}});
}

/**
 * 退出登录
 */
export function logout() {
	// @ts-ignore
	return uni.$uv.http.get('/logout');
}

// 获取登录用户信息
export function getUserInfo() {
	// @ts-ignore
	return uni.$uv.http.get('/info');
}